import request from '@/utils/request'

// 查询所有班级列表
export function listClass(query) {
  return request({
    url: '/school/class/list',
    method: 'get',
    params: query
  })
}

// 查询所有班级详细
export function getClass(classId) {
  return request({
    url: '/school/class/' + classId,
    method: 'get'
  })
}

// 新增所有班级
export function addClass(data) {
  return request({
    url: '/school/class',
    method: 'post',
    data: data
  })
}

// 修改所有班级
export function updateClass(data) {
  return request({
    url: '/school/class',
    method: 'put',
    data: data
  })
}

// 删除所有班级
export function delClass(classId) {
  return request({
    url: '/school/class/' + classId,
    method: 'delete'
  })
}

// 导出所有班级
export function exportClass(query) {
  return request({
    url: '/school/class/export',
    method: 'get',
    params: query
  })
}
// 查询所有班级列表
export function getSchoolForClass(schoolId) {
  return request({
    url: `/school/class/schoolClass/${schoolId}`,
    method: 'get'
  })
}

// 查询所有班级列表学生
export function getSchoolClassStudent(query) {
  return request({
    url: `/school/class/getSchoolClassStudent/${query.schoolId}`,
    method: 'get',
    params:{
      classId:query.classId
    }
  })
}
// 消除学生班级课时
export function classAttendance(classId) {
  return request({
    url: `/school/class/classAttendance/${classId}`,
    method: 'put'
  })
}
// 查询班级学生
export function getClassStudent(classId) {
  return request({
    url: `/classStudent`,
    method: 'get',
    params:{
      classId
    }
  })
}
// 查询学校班级
export function getSchoolClass(classId) {
  return request({
    url: `/school/class/getSchoolClass/${classId}`,
    method: 'get'
  })
}

// 更改学生班级
export function updateStudentClass(data) {
  return request({
    url: `/classStudent`,
    method: 'put',
    data:data
  })
}

// 移除班级学生
export function deleteStudentClass(classStudentId) {
  return request({
    url: `/classStudent/${classStudentId}`,
    method: 'delete'
  })
}
